home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / Mesa / quantizers / dl1 / dl1quant.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-02  |  1.4 KB  |  65 lines

  1. /*
  2.  * File: dl1quant.h
  3.  *
  4.  * Header file for dl1quant.c (DL1 Quantization)
  5.  *
  6.  * Copyright (C) 1993-1997 Dennis Lee
  7.  */
  8.  
  9. /*
  10.  * dl1quant.h
  11.  *
  12.  * Modified  04 Jul 1998
  13.  * by Jarno van der Linden
  14.  * jarno@kcbbs.gen.nz
  15.  *
  16.  * Some minor additions and changes to work with AmigaMesaRTL
  17.  *
  18.  */
  19.  
  20. #ifndef DL1QUANT_H
  21. #define DL1QUANT_H
  22.  
  23. #include "basic.h"
  24.  
  25. GLOBAL int  dl1quant(uchar *inbuf, uchar *outbuf, int width, int height,
  26.              int quant_to, int dither, uchar userpal[3][256]);
  27.  
  28. #ifdef DL1SRC
  29. typedef struct {
  30.     ulong r, g, b;
  31.     ulong pixel_count;
  32.     ulong pixels_in_cube;
  33.     uchar children;
  34.     uchar palette_index;
  35.     } CUBE;
  36.  
  37. typedef struct {
  38.     uchar  level;
  39.     ushort index;
  40.     } FCUBE;
  41.  
  42. typedef struct {
  43.     uchar palette_index,
  44.       red, green, blue;
  45.     ulong distance;
  46.     ulong squares[255+255+1];
  47.     } CLOSEST_INFO;
  48.  
  49. LOCAL  void copy_pal(uchar userpal[3][256]);
  50. LOCAL  void dlq_init(void);
  51. LOCAL  int  dlq_start(void);
  52. LOCAL  void reset(void);
  53. LOCAL  void dlq_finish(void);
  54. LOCAL  int  build_table(uchar *image, ulong pixels);
  55. LOCAL  void fixheap(ulong id);
  56. LOCAL  void reduce_table(int num_colors);
  57. LOCAL  void set_palette(int index, int level);
  58. LOCAL  void closest_color(int index, int level);
  59. LOCAL  int  quantize_image(uchar *in, uchar *out, int width, int height,
  60.                int dither, int base);
  61. LOCAL  int  bestcolor(int r, int g, int b);
  62. #endif
  63.  
  64. #endif
  65.